package com.example.demo.shiro;

import com.example.demo.modal.shiro.TUser;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;

public class ShiroUtils {
    public static Subject getSubjct() {
        return SecurityUtils.getSubject();
    }
    public static TUser getUser() {
        return (TUser)getSubjct().getPrincipal();
    }
    public static int getUserId() {
        return getUser().getId();
    }
    public static void logout() {
        getSubjct().logout();
    }

}